const log4js = require('log4js')

// 使用log4js记录日志
// 1.创建log规则
log4js.configure({
  appenders: {cheese: {type: 'file', filename: 'cheese.log'}},
  categories: {default: {appenders: ['cheese'], level: 'error'}},
})
// 2.创建一个logger，指定配置中的某个logger配置
exports.logger = logger = log4js.getLogger('cheese')
// 3.指定日志的类别
logger.level = 'debug'
